extern int myerrno;

int div(int x, int y)
{
    if(0 == y)
    {
        myerrno = 1;
        return -1;
    }

    return x / y;
}